<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStockRewardsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stock_rewards',function(Blueprint $table){
           $table->increments('id');
           $table->integer('stock_activity_id')->comment('活动ID');//活动id
           $table->integer('user_id')->comment('用户ID');//用户id
           $table->integer('stock_order_id')->comment('订单ID');//订单id
           $table->decimal('money',10,2)->comment('奖金金额');//获奖金额
           $table->integer('level')->comment('获奖激烈');//奖金等级
           $table->string('partner_trade_no')->comment('商户订单编号');
           $table->string('transaction_id')->nullable()->comment('订单流水编号');
           $table->string('payment_time')->nullable()->comment('付款完成时间');
           $table->string('note')->nullable()->comment('付款说明');
           $table->tinyInteger('status')->default(0)->comment('状态0-未付款，1-已付款');;//订单状态
           $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::drop('stock_rewards');
    }
}
